package com.sqlquery.demo.dao;
import com.sqlquery.demo.entity.Role;
import com.sqlquery.demo.entity.User;
import com.sqlquery.demo.entity.User_Role;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface UserDao {

    int add(User user);

    int addRoleById(User_Role user_role);

    int delRoleById(User_Role user_role);

    int update(User user);

    List<Map<String, Object>> findByName(String name);

    //根据id查找
    User findById(Integer id);

    //根据id删除
    int delete(Integer id);

    List<Map<String, Object>> findRoleByUserName(String name);

    List<Map<String, Object>> findUserByRoleName(String name);

    /**
     * 根据用户id查找角色
     *
     * @param id
     * @return
     */
    List<Map<String, Object>> findRoleByUserId(Integer id);

    /**
     * 根据角色id查找用户
     *
     * @return
     */
    List<Map<String, Object>> findUserByRoleId(Integer id);

    List<Map<String, Object>> findAll(Integer page);

    /**
     * 用户名模糊查询
     */

}